#!/usr/bin/env node
let inquirer = require ('inquirer')
let superagent = require("superagent")
let urlencode=require('urlencode')
let translate = [
    {
        type:"input",
        name:"write",
        message:"请输入要查询的星座"
    }
]

inquirer.prompt(translate).then(a =>{
    superagent.get(`http://web.juhe.cn:8080/constellation/getAll?key=1e86cbe4ac7c8e1d23dcc5a133221f7b &type=today&consName=${urlencode(a.write)}`).end((err,res)=>{
        console.log(JSON.parse(res.text))
    })
})